home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 1
/
Nebula One.iso
/
Misc
/
SciCalc1.1
/
Source
/
nxu_dmpevt.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-20
|
5KB
|
141 lines
#include <stdio.h>
#include <dpsclient/dpsfriends.h>
#include <dpsclient/event.h>
void UTL_NxDumpEvent
(/* Arguments */
NXEvent *nxevent, /* pointer to event to be dumped */
int type, /* print(1) or no print(0) event type name */
int data, /* print(1) or no print(0) standard event data */
int variant) /* print(1) or no print(0) variant event data */
{/* BEGIN UTL_NxDumpEvent */
switch (nxevent->type)
{
case NX_NULLEVENT: /* internal use */
if (type) printf("NX_NULLEVENT\n");
break;
case NX_LMOUSEDOWN: /* left mouse-down event */
if (type) printf("NX_LMOUSEDOWN\n");
break;
case NX_LMOUSEUP: /* left mouse-up event */
if (type) printf("NX_LMOUSEUP\n");
break;
case NX_RMOUSEDOWN: /* right mouse-down event */
if (type) printf("NX_RMOUSEDOWN\n");
break;
case NX_RMOUSEUP: /* right mouse-up event */
if (type) printf("NX_RMOUSEUP\n");
break;
case NX_MOUSEMOVED: /* mouse-moved event */
if (type) printf("NX_MOUSEMOVED\n");
break;
case NX_LMOUSEDRAGGED: /* left mouse-dragged event */
if (type) printf("NX_LMOUSEDRAGGED\n");
break;
case NX_RMOUSEDRAGGED: /* right mouse-dragged event */
if (type) printf("NX_RMOUSEDRAGGED\n");
break;
case NX_MOUSEENTERED: /* mouse-entered event */
if (type) printf("NX_MOUSEENTERED\n");
break;
case NX_MOUSEEXITED: /* mouse-exited event */
if (type) printf("NX_MOUSEEXITED\n");
break;
case NX_KEYDOWN: /* key-down event */
if (type) printf("NX_KEYDOWN\n");
if (variant)
{
printf("\treserved: %d\n", nxevent->data.key.reserved);
printf("\trepeat : %d\n", nxevent->data.key.repeat);
printf("\tcharSet : %d\n", nxevent->data.key.charSet);
printf("\tcharCode: %d\n", nxevent->data.key.charCode);
printf("\tkeyCode : %d\n", nxevent->data.key.keyCode);
printf("\tkeyData : %d\n", nxevent->data.key.keyData);
}
break;
case NX_KEYUP: /* key-up event */
if (type) printf("NX_KEYUP\n");
if (variant)
{
printf("\treserved: %d\n", nxevent->data.key.reserved);
printf("\trepeat : %d\n", nxevent->data.key.repeat);
printf("\tcharSet : %d\n", nxevent->data.key.charSet);
printf("\tcharCode: %d\n", nxevent->data.key.charCode);
printf("\tkeyCode : %d\n", nxevent->data.key.keyCode);
printf("\tkeyData : %d\n", nxevent->data.key.keyData);
}
break;
case NX_FLAGSCHANGED: /* flags-changed event */
if (type) printf("NX_FLAGSCHANGED\n");
break;
case NX_KITDEFINED: /* appkit-defined event */
if (type) printf("NX_KITDEFINED\n");
break;
case NX_SYSDEFINED: /* system-defined event */
if (type) printf("NX_SYSDEFINED\n");
break;
case NX_APPDEFINED: /* application-defined event */
if (type) printf("NX_APPDEFINED\n");
break;
case NX_TIMER: /* timer used for tracking */
if (type) printf("NX_TIMER\n");
break;
case NX_CURSORUPDATE: /* cursor tracking event */
if (type) printf("NX_CURSORUPDATE\n");
break;
case NX_JOURNALEVENT: /* event used by journaling */
if (type) printf("NX_JOURNALEVENT\n");
break;
case NX_RESERVEDEVENT4: /* event */
if (type) printf("NX_RESERVEDEVENT4\n");
break;
case NX_RESERVEDEVENT5: /* event */
if (type) printf("NX_RESERVEDEVENT5\n");
break;
case NX_RESERVEDEVENT6: /* event */
if (type) printf("NX_RESERVEDEVENT6\n");
break;
case NX_RESERVEDEVENT7: /* event */
if (type) printf("NX_RESERVEDEVENT7\n");
break;
case NX_RESERVEDEVENT8: /* event */
if (type) printf("NX_RESERVEDEVENT8\n");
break;
case NX_RESERVEDEVENT9: /* event */
if (type) printf("NX_RESERVEDEVENT9\n");
break;
case NX_RESERVEDEVENT10: /* event */
if (type) printf("NX_RESERVEDEVENT10\n");
break;
case NX_RESERVEDEVENT11: /* event */
if (type) printf("NX_RESERVEDEVENT11\n");
break;
case NX_RESERVEDEVENT12: /* event */
if (type) printf("NX_RESERVEDEVENT12\n");
break;
case NX_RESERVEDEVENT13: /* event */
if (type) printf("NX_RESERVEDEVENT13\n");
break;
case NX_RESERVEDEVENT14: /* event */
if (type) printf("NX_RESERVEDEVENT14\n");
break;
case NX_RESERVEDEVENT15: /* event */
if (type) printf("NX_RESERVEDEVENT15\n");
break;
case NX_RESERVEDEVENT16: /* event */
if (type) printf("NX_RESERVEDEVENT16\n");
break;
}/*switch*/
if (data)
{
printf("\tlocation: (%f,%f)\n", nxevent->location.x, nxevent->location.y);
printf("\ttime : %ld\n", nxevent->time);
printf("\tflags : %8.8X\n", (unsigned int)nxevent->flags);
printf("\twindow : %d\n", (int)nxevent->window);
printf("\tctxt : 0x%8.8x\n", (unsigned int)nxevent->ctxt);
}
}/* END UTL_NxDumpEvent */